﻿<%@ Page Language="C#" MasterPageFile="~/Site.Master" AutoEventWireup="true" CodeBehind="Default.aspx.cs" Inherits="Timesheet.WebForm.Projects.Default" %>

<%@ Register Assembly="DevExpress.Web.v14.2, Version=14.2.4.0, Culture=neutral, PublicKeyToken=b88d1754d700e49a" Namespace="DevExpress.Web" TagPrefix="dx" %>

<asp:Content runat="server" ID="BodyContent" ContentPlaceHolderID="MainContent">
    <div class="title">
        <dx:ASPxLabel ID="ASPxLabel2" runat="server" Text="Projects" CssClass="maintitle" Font-Size="22px" Font-Bold="true" ForeColor="#4A72A3"></dx:ASPxLabel>

    </div>
    <div class="detail1">
        <div style="float: left">
            <dx:ASPxGridView
                ID="grvProjects"
                runat="server"
                EnableTheming="True"
                Theme="Office2010Silver"
                SettingsPager-PageSize="15"
                Width="700px"
                DataSourceID="dsPrjects"
                AutoGenerateColumns="False"
                KeyFieldName="PrjID"
                OnRowInserting="grvProjects_RowInserting" Border="0px" OnCommandButtonInitialize="grvProjects_CommandButtonInitialize">

                <Columns>
                    <dx:GridViewDataTextColumn FieldName="PrjID" VisibleIndex="0" ReadOnly="true" Visible="false">
                    </dx:GridViewDataTextColumn>
                    <dx:GridViewDataTextColumn FieldName="ProjectName" Caption="Project" VisibleIndex="1">
                        <DataItemTemplate>
                            <%
                                string url = "#";
                                url = "ProjectMrg.aspx?id=";
                                             
                            %>

                            <a target="_self" href="<%=url%><%# Container.KeyValue%>"><%# Eval("ProjectName").ToString()%></a>
                        </DataItemTemplate>
                    </dx:GridViewDataTextColumn>
                    <dx:GridViewDataTextColumn FieldName="CustomerInfo" Caption="Client" VisibleIndex="2" Width="150px">
                    </dx:GridViewDataTextColumn>
                    <dx:GridViewDataCheckColumn FieldName="Active" VisibleIndex="3" Width="80px">
                    </dx:GridViewDataCheckColumn>
                    <dx:GridViewCommandColumn Caption="Action" ShowDeleteButton="true" VisibleIndex="4" Width="130px" ShowEditButton="true">
                    </dx:GridViewCommandColumn>

                </Columns>

                <SettingsBehavior ColumnResizeMode="Disabled" ConfirmDelete="true" AllowFocusedRow="True" AllowSelectByRowClick="True" />
                <SettingsPager PageSize="15"></SettingsPager>
                <SettingsEditing Mode="Inline">
                </SettingsEditing>
                <Settings HorizontalScrollBarMode="Hidden" />

                <SettingsCommandButton>
                    <UpdateButton ButtonType="Button">
                    </UpdateButton>
                    <CancelButton ButtonType="Button">
                    </CancelButton>
                    <EditButton ButtonType="Button">
                    </EditButton>
                    <DeleteButton ButtonType="Button">
                    </DeleteButton>
                </SettingsCommandButton>
                <Styles>
                    <Header HorizontalAlign="Center" Font-Size="Small">
                    </Header>
                    <AlternatingRow BackColor="#EDF5FF" Enabled="True">
                    </AlternatingRow>
                    <SelectedRow BackColor="#99CCFF">
                    </SelectedRow>
                    <FocusedRow BackColor="#99CCFF">
                    </FocusedRow>
                    <Row Font-Size="11pt" Font-Names="Calibri">
                    </Row>
                </Styles>
            </dx:ASPxGridView>


            <asp:ObjectDataSource
                ID="dsPrjects"
                runat="server"
                DataObjectTypeName="Timesheet.Domain.Project"
                DeleteMethod="Delete"
                InsertMethod="Add"
                SelectMethod="GetRefProjects"
                TypeName="Timesheet.Service.ProjectService"
                UpdateMethod="SimpleUpdate"
                OnObjectCreating="dsPrjects_ObjectCreating">
                <SelectParameters>
                    <asp:SessionParameter DefaultValue="-1" Name="userID" SessionField="UserId" DbType="Int64" />
                </SelectParameters>
            </asp:ObjectDataSource>
        </div>
        <div style="position: relative">
            <div style="margin-left: 10px">
                &nbsp;&nbsp;&nbsp;&nbsp;
                <dx:ASPxButton ID="btnNew" runat="server" Text="New Project" Font-Bold="True" OnClick="Button1_Click" Width="90px"></dx:ASPxButton>
            </div>
        </div>
    </div>
</asp:Content>

